<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>H享会员</title>
    <script src="./js/flexible.js"></script>
    <link rel="stylesheet" type="text/css" href="./css/common.css" />
    <script src="./js/vue.min.js"></script>
    <script src="./js/jquery-2.1.0.js"></script>
    <script src="./js/base64.js"></script>
    <script src="./js/config.js"></script>
    <style>
        *{
            margin:0;
            padding:0;
        }
        #wrap{
            width:100%;
            box-sizing: border-box;
            position: relative;
        }
        .content{
            position: absolute;
            top:0;
            left:0;
            padding-top:4.3rem;
            width:100%;
        }
        .cont{
            width:7.1rem;
            height:6.8rem;
            background:#FFFFFF;
            border-radius: 0.2rem;
            margin:0 auto;
            padding:0.5rem 0.4rem;
        }
        .input-box{
            height: 1rem;
            background: #F6F6F6;
            border-radius: 0.50rem;
            margin: 0 auto;
            padding: 0 0.39rem;
            line-height: 1rem;
            display: flex;
            align-items: center;
            border: 1px solid #C5C5C5;
        }
        .input-box input{
            height:100%;
            width:100%;
            font-size:0.3rem;
        }
        input{
            outline: none;
        }
        .pay-type{
            display: flex;
            justify-content: space-between;
            color:#000000;
            font-size:0.3rem;
            align-items: center;
            padding-top:0.23rem;
            border-top:1px solid #E8E8E8;
            margin-top:0.6rem;
        }
        .pay-type img{
            width:0.38rem;
            height:0.38rem;
        }
        .pay-type span{
            width:2.2rem;
            height:0.56rem;
            line-height: 0.56rem;
            color:#B92518;
            border:1px solid #B92518;
            border-radius: 0.08rem;
            text-align: center;
        }
        .price{
            font-size:0.34rem;
            margin-top:0.10rem;
        }
        .price span{
            color:#0D60E4;
        }
        .btn{
            margin:0 auto;
            margin-top:0.5rem;
            background:#0D60E4;
            color:#fff;
            font-size:0.36rem;
            font-weight: bold;
            width:6.3rem;
            height:1rem;
            line-height: 1rem;
            border-radius: 0.5rem;
            text-align: center;
            position: relative;
        }
        .btn span{
            width:1.6rem;
            height:0.56rem;
            font-size:0.28rem;
            line-height: 0.56rem;
            text-align: center;
            border-radius: 0.23rem 0.23rem 0.23rem 0;
            position: absolute;
            top:-0.3rem;
            right:0.6rem;
            background:#EB4C3D;
        }
        .title{
            display: block;
            margin:0 auto;
            margin-top:0.3rem;
            width:5rem;
            height:0.72rem;

        }
        .item{
            width:6.3rem;
            height:1.76rem;
            margin:0 auto;
            display: block;
            margin-top:0.2rem;
        }
        .a{
            font-size:0.3rem;
            text-align: center;
            margin-top:0.2rem;
            color:#0F60DE;
        }
        .shuoming{
            padding:0.3rem 0.2rem;
            margin-top:0.3rem;
        }
        .shuoming h2{
            color:#040406;
            font-size:0.36rem;
            text-align: center;
        }
        .shuoming p{
            margin:0 auto;
            font-size:0.21rem;
            margin-top:0.2rem;
            width:5.84rem;
        }
        .footer{
            color:#B1B1B1;
            font-size:0.21rem;
            position: absolute;
            bottom:1.9rem;
            margin:0 auto;
            left: 0;
            right:0;
            text-align: center;
        }
        .kefu{
            width:35px;
            background:#EB4C3D;
            border-radius: 20px;
            color:#fff;
            position:fixed;
            right:15px;
            bottom:100px;
            font-size:12px;
            text-align: center;
            line-height: 15px;
            padding:8px 0px;
        }
        .kefu a{
            text-decoration: none;
            color:#fff;
        }
        .kefu img{
            width:30px;
            height:30px;
        }
    </style>
</head>

<body>
<div id="wrap">
    <img style="width:100%" src="./image/bg-a.png" alt="">
    <div class="content">
        <div class="cont">
            <div class="input-box">
                <input type="text" v-model="phone" id="textphone" placeholder="请输入手机号" />
            </div>
            <div class="pay-type">
                <div style="display: flex;align-items: center;">
                    <img style="margin-right:0.1rem" src="./image/icon.png" alt="">
                    <img style="margin-right:0.1rem" src="./image/icon1.png" alt="">
                    在线支付
                    <span style="margin-left:0.2rem">新人随机立减</span>
                </div>
                <img src="./image/icon2.png" alt="">
            </div>
            <p class="price" style="margin-top:0.5rem">
                实际支付金额: <span>50</span>元
                <del style="margin-left:0.2rem;color:#777777;font-size:0.28rem">原价100元</del>
            </p>
            <p class="price">
                实际到账总话费: <span>100</span>元
            </p>
            <div class="btn pay_phone_number_button" @click="login">
                立即支付
                <span>节省50元</span>
            </div>
        </div>
        <img class="title" src="./image/title.png" alt="">
        <img class="item" src="./image/img1.png" alt="">
        <img class="item" src="./image/img2.png" v-for="item in 7" alt="">
        <img class="item" src="./image/img2.png" v-for="item in 7" alt="">
        <img class="item" src="./image/img2.png" v-for="item in 7" alt="">
        <img class="item" src="./image/img2.png" v-for="item in 7" alt="">
        <img class="item" src="./image/img2.png" v-for="item in 7" alt="">
        <img class="item" src="./image/img2.png" v-for="item in 7" alt="">
        <img class="item" src="./image/img2.png" v-for="item in 7" alt="">
        <p class="a">「点击查看更多权益」</p>
        <div class="shuoming">
            <h2>话费礼包说明</h2>
            <p>1.费用说明:一次办理，有效期为十个月，激活会员后，我们将不会再收取任何费用</p>
            <p>2.活动说明:</p>
            <p>2.1 支付 50 元参与话费月月领活动，可获得100元电话资费，关注微信公众号哈尔滨雅可科技有限公司点击【领取话费】,每月可以手动领取10元话费，当月不领则当月话费权益作废。</p>
            <p>2.2 充值失败会自动退款，活动真实有效，如不参与或者觉得活动不适合自己的可以点击下方右侧【客服中心】申请退款有任何问题都可点击左下角输入框发送消息，客服会尽快回复您的问题!</p>
<!--            <p>2.3系统维护时间22:00-9:00，请在其他时间段进行充值。</p>-->
            <p>3.领取方法:关注公众号【哈尔滨雅可科技有限公司】，即可参与活动，话费领取时间段以首次充值计算，比如4号充值，当月可以领取第一次，次月4号开始可领取第二次，以此类推。</p>
            <p>4.我们为您精心挑选的电话资费充值福利，只为帮您以最低的成本享受更高的资费使用权益.，已购买并领取权益的用户订单不支持退货退款，请确认后再下单。</p>
            <p>5.如有疑问请拨打我们的客服电话:010-53396307</p>
        </div>
    </div>
    <div class="footer">
        北京数慧生活科技有限公司<br/>
        京ICP备2022030573号-9<br/>
        010-53396307
    </div>
    <!-- 客服售后 -->
    <div class="kefu">
        <a href="tel:010-53396307">
            <img src="./image/kefu.png" alt="">
            客服售后
        </a>
    </div>
    <!-- 页面提示 -->
    <!--<div class="shade-phone"  v-if="showPhone">
        {{showPhoneText}}
    </div>-->
    <!-- 支付宝h5提交 -->
</div>
</body>

</html>
<script>
    //获取url参数
    function getUrlParams(index = '') {
        const params = {};
        const url = window.location.href;
        const urlObj = new URL(url);
        for (const [key, value] of urlObj.searchParams.entries()) {
            if(index && index === key){
                return value;
            }
            params[key] = value;
        }
        return params;
    }

    $(function (){
        //判断来源
        let params = getUrlParams();
        let source = '';
        let sourceLicense = '';

        if(params['qcjParamStr']){
            source = 'qcjParamStr';
            sourceLicense = params['qcjParamStr'];
        }else if(params['bxm_id']){
            source = 'bxmid';
            sourceLicense = params['bxm_id'];
        }else if(params['a_oId']){
            source = 'tuia';
            sourceLicense = params['a_oId'];
        }

        if(params['phone']){
            let phone = atob(params['phone']);
            if(phone){
                $("#textphone").val(phone);
            }
        }

        $('.pay_phone_number_button').on('click', function () {
            let phone = $('#textphone').val();
            var regex = /^1\d{10}$/;
            if(! regex.test(phone)){
                alert("请输入正确的手机号");
                return false;
            }

            $.ajax({
                type : 'POST',
                url : domain + '/api/pb/setOrder',
                data : {
                    phone: phone,
                    source: source,
                    sourceLicense: sourceLicense
                },
                success : function (res) {
                    if(res.code === 1){
                        location.href = res.data.url;
                    }else{
                        alert(res.msg);
                    }
                }
            });
        });
    })
</script>
